xportethxe 2.2.1
Loading...
Searching...
No Matches
main.c File Reference

XPort ETH XE Click Example. More...

#include "board.h"
#include "log.h"
#include "xportethxe.h"

Macros

#define MIKROBUS_POSITION_XPORTETHXE   MIKROBUS_1
#define APP_BUFFER_SIZE   300
#define PROCESS_BUFFER_SIZE   100

Functions

void application_init (void)
void application_task (void)
int main (void)

Detailed Description

XPort ETH XE Click Example.

Description

This example demonstrates the use of the XPort ETH XE Click board for Ethernet communication. The application initializes the XPort ETH XE module, retrieves essential information such as firmware version, MAC address, and network status, and demonstrates sending a ping command. It also allows for bidirectional UART communication between the USB UART and the XPort ETH XE UART.

The demo application is composed of two sections :

Application Init

Initializes the UART communication, logs essential information, configures the XPort ETH XE module, and retrieves the firmware version, MAC address, and network status. It also demonstrates basic command operations such as pinging the specific IP address (8.8.8.8).

Application Task

Continuously reads data from the USB UART and forwards it to the XPort ETH XE module, while also capturing responses from the module and forwarding them back to the USB UART. This allows real-time interaction with the device through the UART Terminal for configuration and diagnostics.

Additional Function

  • static void xportethxe_clear_app_buf ( void )
  • static err_t xportethxe_process ( xportethxe_t *ctx )
  • static err_t xportethxe_read_response ( xportethxe_t *ctx )
Note
Ensure the XPort ETH XE Click board is properly connected to the network.
Author
Stefan Filipovic

Macro Definition Documentation

◆ APP_BUFFER_SIZE

#define APP_BUFFER_SIZE   300

◆ MIKROBUS_POSITION_XPORTETHXE

#define MIKROBUS_POSITION_XPORTETHXE   MIKROBUS_1

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   100

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )